Yukar²da anlatt²≡²m²z iki i■lemi programlar²n²zda uygulamak pek de zor de≡ildir. ╓rnek resimde g÷rdⁿ≡ⁿnⁿz kontrolleri form ⁿzerinde olu■turduktan sonra liste kutusunun ismini ' listsol' metin kutusunun ismini textsag olarak belirleyin. Form ⁿzerinde bu iki kontrol d²■²nda bir de resim kutusu olu■turarak ismini ' ayirac' olarak atay²n.
Program² τal²■t²r²p ortadaki ay²rac² sa≡a sola kayd²r²n, formu kⁿτⁿltⁿp bⁿyⁿltⁿn, t²pk² Windows Gezgini gibi ■ekil alacakt²r.
' A■a≡²daki kodlar bo■ bir BAS modⁿlⁿnⁿn iτinde ' General-Declarations b÷lⁿmⁿne yaz²lacak. Option Explicit Private Const SPLT_WDTH As Integer = 5 Private currSplitPosX As Long Dim CTRL_OFFSET As Integer Dim SPLT_COLOUR As Long ' A■a≡²daki kodlar formun ilgili ' yerlerine yerle■tirilecek. Private Sub Form_Load() CTRL_OFFSET = 5 SPLT_COLOUR = &H808080 currSplitPosX = &H7FFFFFFF listsol.AddItem ' Listedeki 1. ÷≡e' listsol.AddItem ' Listedeki 2. ÷≡e' textsag.Text = ' ╓rnek bir metin' End Sub Private Sub Form_Resize() Dim x1 As Integer Dim x2 As Integer Dim height1 As Integer Dim width1 As Integer Dim width2 As Integer On Error Resume Next height1 = ScaleHeight - (CTRL_OFFSET * 2) width1 = listsol.Width x1 = CTRL_OFFSET x2 = x1 + width1 + SPLT_WDTH - 1 width2 = ScaleWidth - x2 - CTRL_OFFSET listsol.Move x1 - 1, CTRL_OFFSET, width1, height1 textsag.Move x2, CTRL_OFFSET, width2 + 1, height1 ayirac.Move x1 + listsol.Width - 1, CTRL_OFFSET, SPLT_WDTH, height1 End Sub Private Sub ayirac_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = vbLeftButton Then ayirac.BackColor = SPLT_COLOUR currSplitPosX = CLng(x) Else If currSplitPosX <> &H7FFFFFFF Then ayirac_MouseUp Button, Shift, x, y currSplitPosX = &H7FFFFFFF End If End Sub Private Sub ayirac_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) If currSplitPosX& <> &H7FFFFFFF Then If CLng(x) <> currSplitPosX Then ayirac.Move ayirac.Left + x, CTRL_OFFSET, SPLT_WDTH, ScaleHeight - (CTRL_OFFSET * 2) currSplitPosX = CLng(x) End If End If End Sub Private Sub ayirac_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) If currSplitPosX <> &H7FFFFFFF Then If CLng(x) <> currSplitPosX Then ayirac.Move ayirac.Left + x, CTRL_OFFSET, SPLT_WDTH, ScaleHeight - (CTRL_OFFSET * 2) End If currSplitPosX = &H7FFFFFFF ayirac.BackColor = &H8000000F If ayirac.Left > 60 And ayirac.Left < (ScaleWidth - 60) Then listsol.Width = ayirac.Left - listsol.Left ElseIf ayirac.Left < 60 Then listsol.Width = 60 Else: listsol.Width = ScaleWidth - 60 End If Form_Resize End If End Sub